import './App.scss'
// 导入路由
import { Router, Route, Switch, Redirect } from 'react-router-dom'

// 导入页面组件
import Login from './pages/Login'
import Layout from './pages/Layout'
import NotFound from './pages/NotFound'
import AuthRoute from '@/components/auth'
import Test from '@/pages/test/index'
// 导入自定义history对象
import customHistory from '@/utils/history.js'

function App() {
  return (
    <Router history={customHistory}>
      <div className="app">
        {/* <div className="box">
          <h1>scss使用</h1>
        </div> */}
        {/* 配置路由规则 */}
        <Switch>
          <Redirect exact from="/" to="/home" />
          {/* <Route path="/home" component={Layout}></Route> */}
          <AuthRoute path="/home" component={Layout} />
          <Route path="/login" component={Login}></Route>
          <Route path="/test" component={Test}></Route>
          {/* 404 */}
          <Route component={NotFound} />
        </Switch>
      </div>
    </Router>
  )
}

export default App
